import request from '@/utils/request'

export default {
  // 获取用户list
  listPage(page, limit, searchObj) {
    return request.service({
      url: `/crawler/admin/listPage/${page}/${limit}`,
      method: 'post',
      data: searchObj
    })
  },

  // 获取用户详细信息
  getInfoById(id) {
    return request.service({
      url: `/crawler/admin/getInfoById/${id}`,
      method: 'get'
    })
  },

  // 永久删除用户
  foreverRemove(id) {
    return request.service({
      url: `/crawler/admin/foreverRemove/${id}`,
      method: 'get'
    })
  },

  // 更新用户信息
  updateById(detailObj) {
    return request.service({
      url: `/crawler/admin/updateById`,
      method: 'post',
      data: detailObj
    })
  },

  // 新增用户信息
  insertUserInfo(insertObj) {
    return request.service({
      url: `/crawler/admin/insertUserInfo`,
      method: 'post',
      data: insertObj
    })
  },

  // 设置用户公告已读状态
  setNoticeStatus(userId) {
    return request.service({
      url: `/crawler/admin/setNoticeStatus`,
      method: 'get',
      params: { userId }
    })
  }
}
